#encoding='gbk'


import unittest

import random

class myclass(object):
    @classmethod
    def sum(self,a,b):
        return a+b
    @classmethod
    def sub(self,a,b):
        return a-b


class mytest(unittest.TestCase):
    @classmethod
    def setUpClass(cls):
        print('--------setUpclass')
    @classmethod
    def tearDownClass(cls):
        print('--------tearDownclass')
    def setUp(self):
        self.a=3
        self.b=1
        print('---- setUp')
    def tearDown(self):
        print('--tearDown')
    def testsum(self):
        self.assertEqual(myclass.sum(self.a,self.b),4,'test sum fail')
    def testsub(self):
        self.assertEqual(myclass.sub(self.a,self.b),2,'test sub fail')

if __name__== '__main__':
    unittest.main()